require "symasm.wc"
loadlib input
loadlib IO

glob
	ed = 0
	ev = 0
end


asm
	push "/dev/input/event5" evdev_open -$ed
	+$ed evdev_get_name push "\n" print 2
	push "wait for event\n" print 1
	+$ed _funpack 'e' -$ev
	push "got event\n" print 1
	push "date : " +$ev evGetDate push "\n" print 3
	push "type : " +$ev evGetType push "\n" print 3
	push "code : " +$ev evGetCode push "\n" print 3
	push "value : " +$ev evGetValue push "\n" print 3
	+$ed close
	push 0 -$ed
end

